#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 1e5 + 10;

ll read(){
    ll x = 0, t = 1;
    char c = getchar();
    while(c < '0' || c > '9'){
        if(c == '-') t = -t;
        c = getchar();
    }
    while(c >= '0' && c <= '9'){
        x = (x << 1) + (x << 3) + (c ^ 48);
        c = getchar();
    }

    return x * t;
}

void print(ll x){
    if(x < 0){
        putchar('-');
        print(-x);
        return;
    }
    if(x > 9){
        print(x / 10);
    }
    putchar((x % 10) ^ 48);
}

ll n, m;

ll a[N];

int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);

    n = read();
    
    for(int i = 1; i <= n; i++){
        a[i] = read();
    }

    sort(a + 1, a + n + 1);

    int l = 1, r = 2;
    ll ans = 0;

    while(l<= n && r <= n){
        while(r <= n && a[l] >= a[r]) r++;
        if(r <= n){
            ans ++;
            l++;
            r++;
        }
        else break;
    }

    print(n - ans);

    return 0;
}
/*
‐O2 ‐std=c++14 ‐static

*/